package com.example.lombok;

import lombok.Builder;
import lombok.ToString;

import java.util.Date;

/**
 * @author shanchong
 * @date 2019-06-23
 **/
@Builder
@ToString
public class BuilderDemo {

    private String name;

    private Integer age;

    private Date createDate;

    /**
     * @Builder：用在类、构造器、方法上，为你提供复杂的builder APIs，让你可以像如下方式一样调用Person.builder().name("Adam Savage").city("San Francisco").job("Mythbusters").job("Unchained Reaction").build();
     * @param args
     */
    public static void main(String[] args) {
        BuilderDemo builderDemo = BuilderDemo.builder().name("shanchong").age(1).createDate(new Date()).build();
        System.out.println(builderDemo);
    }

}
